<?php
class DemoController extends CController{
    public function actionIndex(){
        $model = new FirstForm;
        if(isset($_POST['FirstForm'])){
            $model->attributes=$_POST['FirstForm'];
            if($model->validate()){
                //$sql = 'insert into test_table(name,oneword) value(\''.$model->typedOne.'\',\''.$model->typedTwo.'\')';
                $connection = Yii::app()->db;
                //$command = $connection->createCommand($sql);
                $command=$connection->createCommand();
                $rowcount = $command->insert('test_table', array(
                   'id'=>NULL,
                    'name'=>$model->typedOne,
                    'oneword'=>$model->typedTwo
                ));
                echo $model->typedOne.' + '.$model->typedTwo;
            }
        }
        $this->render('index', array(
           'title'=>'Yii Demo Page',
            'model'=>$model
        ));
    }
    
}
